package cn.app.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import cn.app.dao.MerchandiseDisplay.MerchandiseDisplayDao;
import cn.app.entity.Commodity;
import cn.app.service.MerchandiseDisplay;
@Service
@Transactional
public class MerchandiseDisplayImpl  implements MerchandiseDisplay{

	@Autowired
	private MerchandiseDisplayDao merchandiseDisplayDao;

	@Override
	public List<Commodity> query() {
		
		return merchandiseDisplayDao.query();
	}

	@Override
	public int addGoods(Commodity commodity) {
//		String name = commodity.getName();
//		double money = commodity.getMoney();
//		String logolocpath = commodity.getLogolocpath();
//		String pic = commodity.getPic();
		
		
		return merchandiseDisplayDao.addGoods(commodity);
	}

	@Override
	public Commodity queryId(Commodity commodity) {
	
		return merchandiseDisplayDao.queryId(commodity);
	}

	@Override
	public void addToShoppingCart(Commodity listCommodity) {
		System.out.println(listCommodity);
		merchandiseDisplayDao.addToShoppingCart(listCommodity);
	}

	@Override
	public List<Commodity> ShoppingCartandName(String username) {
		
		return merchandiseDisplayDao.ShoppingCartandName(username);
	}

	
}
